package com.kaiwukj.android.ufamily.mvp.http.api.service;

import com.kaiwukj.android.ufamily.mvp.http.entity.base.BaseListResp;
import com.kaiwukj.android.ufamily.mvp.http.entity.base.BaseObjResp;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.OrderCreateResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.OrderDetailResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.OrderEvaluateResult;
import com.kaiwukj.android.ufamily.mvp.http.entity.result.OrderResult;

import java.util.Map;

import io.reactivex.Observable;
import okhttp3.RequestBody;
import retrofit2.http.Body;
import retrofit2.http.GET;
import retrofit2.http.POST;
import retrofit2.http.Query;

public interface OrderService {

    @GET("/order/app/serviceOrder/queryMyOrdersByStatus")
    Observable<BaseListResp<OrderResult>> fetchOrder(@Query("page") int page,
                                                     @Query("pageSize") int pageSize,
                                                     @Query("orderStatus") int status);

    @GET("/order/app/userEvaluation/listEvaluatedOrders")
    Observable<BaseListResp<OrderEvaluateResult>> fetchEvaluatedOrder(@Query("page") int page,
                                                                      @Query("pageSize") int pageSize);

    @GET("/order/app/userEvaluation/listNotEvaluatedOrders")
    Observable<BaseListResp<OrderEvaluateResult>> fetchNotEvaluatedOrder(@Query("page") int page,
                                                                         @Query("pageSize") int pageSize);

    @POST("/order/app/userEvaluation/addEvaluation")
    Observable<BaseObjResp<Integer>> orderEvaluation(@Body RequestBody body);

    @POST("/order/app/serviceOrder/addOrder")
    Observable<BaseObjResp<OrderCreateResult>> createServiceOrder(@Body RequestBody body);

    @POST("/order/app/serviceOrder/orderPay")
    Observable<BaseObjResp<Map<String, Object>>> payOrder(@Body RequestBody body);

    @GET("/order/app/serviceOrder/queryMyOrderInfoById")
    Observable<BaseObjResp<OrderDetailResult>> getOrderById(@Query("orderId") Integer id);

    @GET("/order/app/serviceOrder/cancelMyOrder")
    Observable<BaseObjResp<Integer>> cancelOrder(@Query("orderId") Integer orderId);

    @GET("/order/app/serviceOrder/deleteMyOrder")
    Observable<BaseObjResp<Integer>> deleteOrder(@Query("orderId") Integer orderId);

    @POST("/order/app/serviceOrder/refund")
    Observable<BaseObjResp<Integer>> refundOrder(@Body RequestBody body);

    @GET("/order/app/serviceOrder/cancelRefund")
    Observable<BaseObjResp<Integer>> cancelRefund(@Query("orderId") Integer orderId);


}
